'use strict';

angular.module('biblioApp').service('Adding', [ '$http', function Adding($http) {
    return {
        add:function (ubd,number,title,author,place,year) {
            var params = {
                "udk":ubd,
                "invbr":number,
                "naslov":title,
                "autor":author,
                "mesto":place,
                "godina":year
            };
            return $http({ method:'GET', url:'http://biblio.homenet' +
                "/add.php",
                params:params, cached:false, withCredentials:false})
                .success(function (data, status) {
                    return data;
                }).error(function (data, status) {
                    alert('Error');
                });
        }
    }
}]);
